package com.itbupt.service;

import com.itbupt.domain.po.PayOrder;
import com.itbupt.domain.req.ShopCartReq;
import com.itbupt.domain.res.PayOrderRes;

import java.util.List;

/**
 * @Author dingchang
 * @Date 2025/5/8 11:41
 * @Description: 订单服务接口
 */
public interface IOrderService {

    /**
     * 创建订单
     * @param shopCartReq
     * @return
     * @throws Exception
     */
    PayOrderRes createOrder(ShopCartReq shopCartReq) throws Exception;

    /**
     * 查询未支付的订单
     * @return
     */
    List<String> queryNoPayNotifyOrder();

    /**
     * 接收回调消息后，更新订单状态，并发送MQ
     * @param orderId
     */
    void changeOrderPaySuccess(String orderId);

    /**
     * 查询超时未支付订单
     * @return
     */
    List<String> queryTimeoutCloseOrderList();

    /**
     * 关闭订单 - 状态为 close
     * @param orderId
     * @return
     */
    boolean changeOrderClose(String orderId);

}
